
; Bazooka Class
; projectile that hurts on impact and delivers splash damage

(load "weapon.scm")
(load "explosion.scm")


(define bazooka%
  (class weapon%
    
    ; PHYSICS-OBJECT%
    (inherit-field position
                   collision-occured)
    ; WEAPON%
    (inherit inflict-damage)
    
    ; Update
    (define/override (update)
      (when collision-occured
        ; inflict damage
        (inflict-damage)
        ; add explosion
        (send *world* add-object (new explosion% [magnitude 2] [position position] [damage 10])))
      ; return
      (not collision-occured))
    
    ; Constructor/Initialization
    (super-new [bounce #f] [weapon-name "bazooka"] [weapon-speed #i500] [clip-size 6] [fire-rate #i1/2] [reload-time #i4] [damage 2])))

